<template>
	<view>
		<qrcode-poster ref="poster" :title="title" :content="content"></qrcode-poster>
		<button type="default" @click="test()">生成海报</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '微信扫一扫，邀好友，得红包',
			}
		},
		methods: {
			test() {
				this.$refs.poster.showCanvas('https://cos.xunmeng.icu/cartoonrabbit/s0mv9hqhlp_1673326356513.png' )
			}
		}
	}
</script>

<style lang="scss">
	//样式
	.pc-container {
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: rgba(0, 0, 0, 0.5);
	}

	.canvas-wrapper {
		background-color: #FFFFFF; // 在这里设置海报的白色 背景 是无效的，注意！！！必须通过代码设置
		width: 100%;
		box-sizing: border-box;
		min-height: 996rpx;
	}
</style>
